<template>
    <div class="homeRight">
        <ul v-if="!$route.params.id">
            <li v-for="item in parentData" :key="item.id" @click="handleDetail(item.id)">
                <span>{{item.title}}</span>
                <i>{{item.time}}</i>
            </li>
        </ul>
        <router-view />
    </div>
</template>

<script>
export default {
    props:['parentData'],
    data () {
        return {
            
        }
    },
    methods: {
        handleDetail(id){
            this.$router.push({path:'/home/homeDetail/'+id});
        }
    }
}
</script>

<style scoped lang="scss">
.homeRight {
    ul {
        li {
            display: flex;
            justify-content: space-between;
            border-bottom: 1px dashed #ccc;
            span,
            i {
                display: block;
                padding: 10px 10px 5px 10px;
            }
        }
    }
}
</style>